<template>
  <div class="tableDialog">
    <el-row v-if="modalRow.showButton">
      <div style="float: right">
        <el-button @click="transmit">转发</el-button>
        <el-button @click="exportData">导出</el-button>
        <el-button @click="toPrint">打印</el-button>
        <el-button @click="toLetters">致信交流</el-button>
      </div>
    </el-row>
    <el-row v-if="modalRow.showQuery">
      <el-form
        ref="ruleForm"
        label-width="100px"
        :model="queryParams"
        style="margin-top: 20px"
      >
        <el-row :gutter="20">
          <el-col :span="6">
            <el-form-item label="项目名称">
              <el-input v-model="queryParams.role" placeholder="搜索关键字"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6" align="right">
            <div style="padding-bottom: 20px">
              <el-button type="primary" icon="el-icon-search" size="small">筛选</el-button>
              <el-button icon="el-icon-refresh" size="small">重置</el-button>
            </div>
          </el-col>
        </el-row>
      </el-form>
    </el-row>
    <el-row>
      <form-table :showIdx="false" status="read" :tableState="modalRow.value" :tableColumns="modalRow.columns"
                  :tableData="tableData" style="margin-bottom: 25px"></form-table>
    </el-row>
    <el-row>
      <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                  style="margin: 0 25px 28px;"/>
    </el-row>
  </div>
</template>

<script>
import FormTable from "@/views/leader/components/formTable";

export default {
  name: "tableDialog",
  components: {FormTable},
  data() {
    return {
      queryParams: {
        pageNum: 1,
        pageSize: 20
      },
      total: 0,
      tableData:[]
    }
  },
  props: ['modalRow'],
  watch:{
    modalRow:{
      handler(val) {
        this.tableData = this.modalRow.tableData
      },
      immediate: true,
    }
  },
  methods: {
    //转发
    transmit(){
      this.$modal.msg('转发');
    },
    //导出
    exportData(){
      this.$modal.msg('导出');
    },
    //打印
    toPrint(){
      this.$modal.msg('打印');
    },
    //致信交流
    toLetters(){
      this.$modal.msg('致信交流');
    }
  }
}
</script>

<style scoped lang="scss">
.tableDialog{
  margin: 0 20px;
  ::v-deep{
    .el-table th.el-table__cell.is-leaf, .el-table td.el-table__cell {
      border-bottom: 1px solid #dfe6ec !important;
    }
  }
}
</style>
